package chapter5;

public class StaticDataInitialize {
	@SuppressWarnings("unused")
	private static int staticData=f();
	private static int f()
	{
		System.out.println("static");
		return 1;
	}
	
	@SuppressWarnings({ "unused"})
	private int objectData=g();
	private int g()
	{
		System.out.println("object");
		return 1;
	}
	
	public StaticDataInitialize()
	{
		System.out.println("constructor");
	}

	/**
	 * @param args
	 */
	
	//初始化顺序：static field->object field->constructor
	//static field 只初始化一次
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new StaticDataInitialize();
		new StaticDataInitialize();

	}

}
